list2=input().split()
m=int(list2[0])
n=int(list1[1])
nums=map(int,input().split())


nums.sort(reverse=True)
count=0
i=0
while i <len(nums):
    if nums[i]>= m:
        count+=1
        nums.pop(i)
        i-=1
    i+=1
left=0
right=len(nums)-1
while left < right:
    if nums[left]+nums[right]>m:
        count+=1
        left+=1
    elif nums[left]+nums[right]<=m:
        count+=1
        left+=1
        right-+1
if left==right:
    count+=1

print(count)

